import dicts


def find_nearest_prime(number):
    if number < 2:
        return 2
    elif number == 2:
        return 2
    elif number % 2 == 0:
        return find_nearest_prime(number + 1)
    else:
        for num in range(number + 1, 0, -1):
            if all(num % i != 0 for i in range(2, num)):
                return num
    return -1


def str_to_int(str_num: str) -> int:
    num_list = []
    splited_str = str_num.split(" ")
    try:
        for i in splited_str:
            num_list.append(dicts.str_an_int[i])
    except KeyError:
        return False, "Wrong input"
    return True, int(''.join(map(str, num_list)))
